import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import type { TableColumnsType } from 'ant-design-vue'
import type { Config } from '@/types/api/config/config'

export const useTableColumns = () => {
  const { t } = useI18n()
  
  return computed<TableColumnsType<Config>>(() => [
    {
      title: t('setting.configName'),
      dataIndex: 'configName',
      key: 'configName',
      width: 180
    },
    {
      title: t('setting.configKey'),
      dataIndex: 'configKey',
      key: 'configKey',
      width: 180
    },
    {
      title: t('setting.valueType'),
      dataIndex: 'valueType',
      key: 'valueType',
      width: 100
    },
    {
      title: t('setting.configValue'),
      dataIndex: 'configValue',
      key: 'configValue',
      ellipsis: true
    },
    {
      title: t('setting.isBuiltin'),
      dataIndex: 'builtIn',
      key: 'builtIn',
      width: 100,
      align: 'center'
    },
    {
      title: t('common.action'),
      key: 'action',
      width: 180,
      fixed: 'right',
      align: 'center'
    }
  ])
} 